-- GENERATED SPELL FOR [Dalaran Wizard] --


function spell0_1889(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(12544,pUnit)
pUnit:RegisterEvent('Sorts_1889', 0, 1)
end

function spell1_1889(pUnit, Event) --@Frost Nova,Self--
pUnit:FullCastSpellOnTarget(122,pUnit)
pUnit:RegisterEvent('Sorts_1889', 8000, 1)
end

function spell2_1889(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(20792,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1889', 7000, 1)
end

function spell3_1889(pUnit, Event) --@Quick Frost Ward,n/a--
pUnit:FullCastSpellOnTarget(4980,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1889', 11500, 1)
end

function Sorts_1889(pUnit, Event)
local choix_sorts_1889 = math.random(0, 3)
if choix_sorts_1889 == 0 then
pUnit:RegisterEvent('spell0_1889', 1, 1)
end
if choix_sorts_1889 == 1 then
pUnit:RegisterEvent('spell1_1889', 1, 1)
end
if choix_sorts_1889 == 2 then
pUnit:RegisterEvent('spell2_1889', 1, 1)
end
if choix_sorts_1889 == 3 then
pUnit:RegisterEvent('spell3_1889', 1, 1)
end
end

function mob1889_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1889', math.random(1500, 3000), 1)
end

function mob1889_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1889_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1889_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1889, 1, 'mob1889_Action')
RegisterUnitEvent(1889, 2, 'mob1889_Leave')
RegisterUnitEvent(1889, 3, 'mob1889_Kill')
RegisterUnitEvent(1889, 4, 'mob1889_Die')
